'use strict';

var _path = require('path');

var _path2 = _interopRequireDefault(_path);

var _debug2 = require('debug');

var _debug3 = _interopRequireDefault(_debug2);

var _utils = require('../utils');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var debug = (0, _debug3.default)('build-tools:lint');

debug('Config path from eslint webpack resolver:', _path2.default.join(__dirname, '../build/webpack.eslint.js'));

module.exports = {
  extends: ['airbnb', 'plugin:jest/recommended'],
  parser: 'babel-eslint',
  env: {
    es6: true,
    browser: true,
    node: true,
    jest: true
  },
  plugins: ['react', 'babel', 'jest'],
  rules: {
    'class-methods-use-this': ['error', {
      exceptMethods: ['componentDidMount', 'componentDidUpdate', 'componentWillMount', 'componentWillReceiveProps', 'componentWillUnmount', 'componentWillUpdate', 'render', 'shouldComponentUpdate']
    }],
    semi: ['warn', 'never'],
    'arrow-parens': ['error', 'as-needed'],
    'no-unused-expressions': 'off',
    'no-underscore-dangle': 'off',
    'react/jsx-uses-vars': 'warn',
    'react/prefer-stateless-function': ['error', {
      ignorePureComponents: true
    }],
    'object-shorthand': 'warn',
    'generator-star-spacing': ['warn', 'after'],
    'import/no-named-as-default': 'off',
    'react/jsx-filename-extension': ['error', {
      extensions: ['.jsx', '.js']
    }],
    'jsx-a11y/no-static-element-interactions': 'off',
    'jsx-a11y/label-has-for': ['warn', ['label']]
  },
  settings: {
    'import/resolver': {
      node: {
        paths: [_path2.default.join((0, _utils.getRootPath)(), 'src'), '.', 'node_modules']
      },
      webpack: {
        config: _path2.default.join(__dirname, '../build/webpack.eslint')
      }
    }
  }
};